﻿<%'检查是否登录%>
<!--#include file="../Include/checklogin.asp"-->
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--#include file="../Include/Start.asp"-->

<!--#include file="../Include/Common.Security.asp"-->

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="消费记录保存网作为消费记录存储分析服务提供商，为企业和个人提供稳定的完全免费的消费记录信息处理服务。" />
<meta name="keywords"
	content="消费记录保存网,消费记录,www.im315.com,im315.com,im315"
/>
 <!--meta信息-->
	<!--#include file="../Include/meta.asp"-->
	<!--end meta-->
<title>消费记录保存网</title>

<link href="../css/css-1.05.css" rel="stylesheet" type="text/css" />
<link href="../css/console-1.03.css" rel="stylesheet" type="text/css" />
<link href="../css/calendar.css" rel="stylesheet" type="text/css" />
<link href="../css/console_home-1.06.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="../js/jquery.extend-1.06.js"></script>
<script type="text/javascript" src="../js/common_1.01.js"></script>
<script type="text/javascript" src="../js/console_role.js"></script>
<script type="text/javascript" src="../js/calendar/WdatePicker.js"></script>
<script type="text/javascript" src="../js/menu.js"></script>
<script type="text/javascript" src="../js/TrimPathTemplate.js"></script>
</head>

<body>
<div class="wrapper">

	<!--header页头信息-->
	<!--#include file="../Include/header.asp"-->
	<!--end header页头信息-->


	<!--navigation菜单信息-->
	<!--#include file="../Include/navigation.asp"-->
	<script type="text/javascript">$("#navigation").menu('point');</script>
	<!--end navigation菜单信息-->

<!--begin container-->
<div class="container" id="container">
 
	
	<div class="c_left">
		<h2>权限管理</h2>
		<ul>
			<li><h3><a href="/admin/users.asp">用户</a></h3></li>
			<li class="on"><h3><a href="/admin/roles.asp">角色</a></h3></li>
			<li><h3><a href="/admin/resources.asp">资源</a></h3></li>
		</ul>
	</div>
	<div class="c_right">
		<div class="c_r_head">
			<ul class="head_tab">
				<li><h4><a href="roles.asp##div_tab_list">角色管理</a></h4></li>
				<li class="on"><h4><a href="#">修改</a></h4></li>
				<li><h4><a href="roles.asp##div_tab_add">新增</a></h4></li>
			</ul>
		</div>	<%
	 	''定义查询字段变量
 	dim role_id,role_name
	
''用户信息
		role_id=ReplaceBadChar(Trim(request("role_id")))
		if(""=role_id) then response.redirect "/roles.asp" ''如果id并没有传来跳转回原处
			''Dim rsObj,strSql
			set rsObj=Server.CreateObject("ADODB.Recordset")
			strSql = "Select  *  "
  		strSql=strSql & "  from T_ROLE where id='"&role_id&"' "
			''Response.Write strSql&"-----"
			rsObj.Open strSql, Conn, 1, 3
			If rsObj.BOF And rsObj.EOF Then 
				 response.redirect "/roles.asp" ''如果id并没有传来跳转回原处
			end if	 
			id=Trim(rsObj("id"))
			role_name=Trim(rsObj("role_name"))
			''关闭链接
			rsObj.close		

	%>	
		
		<div class="c_r_body" id="div_tab_edit">
			<form action="roles_do.asp" method="post" id="form_edit">
				<input id="role_id" name="role_id" type="hidden" value="<%=id%>" />
			<div align="center" style="height:25px">
			请输入商品的详细信息
			</div>
				<table width="100%" border="0" cellpadding="2" cellspacing="4" style="margin:auto">
		 
					<tr>
						<td align="right">用户代码:</td>
						<td><%=id%></td>
					</tr>
					<tr>
						<td align="right">角色名称:</td>
						<td><input type="text" name="role_name" id="role_name"  value="<%=role_name%>" class="text" style="width:100px" maxlength="14" /></td>
					</tr>
					<tr>
						<td align="right">[该角色的资源]:</td>
						<td></td>
					</tr>
				
						<table width="100%" border="0" cellpadding="2" cellspacing="0" class="list">
					<colgroup>
						<col width="30"/>
						<col/>
						<col/>
						<col/>
						<col/>
						<col/>
					</colgroup>
					<thead>
						 <tr>
							<th align="center"><input type="checkbox" onclick="checkboxAll('id_all',this)" id="checkboxAllt" name="checkboxAllt"/></th>
							<th>资源代码</th>
							<th>资源名称</th>
							<th>菜单名称</th>
							<th>对应URL</th>
							<th>节点路径</th>
						</tr>
					</thead>
					<tr class="line">
						<td colspan="6"><div></div></td>
					</tr>
					<tbody>
								<%
			''查找改用户的角色		
			strSql = " SELECT T_RES.*,  nn.res_id AS role_res_i   "
			strSql=strSql & " ,T_RES.res_ppath + CAST(T_RES.id AS VARCHAR(10)) + '_' AS res_path  "
			strSql=strSql & "  FROM T_RES  LEFT OUTER JOIN  "
			strSql=strSql & "  (SELECT mm.* FROM T_ROLE_RES mm WHERE mm.role_id = '"&id&"') nn ON T_RES.id = nn.res_id "
			strSql=strSql & "  order by res_path  "
			''Response.Write strSql&"-----"

			rsObj.Open strSql, Conn, 1, 3			 
			do while not rsObj.eof
				%>
						<%dim tr_class%>
					<%if "bgblue"=tr_class then tr_class ="" else tr_class ="bgblue" end if%>
				  <tr class="<%=tr_class%>" onmouseover="$(this).addClass('on')" onmouseout="$(this).removeClass('on')">
					<td align="right"><input type="checkbox" id="id_all" name="id_all" 
						<%if Not IsNull(rsObj("role_res_i")) then Response.Write " checked "%> 
						value="<%=Trim(rsObj("id"))%>"/></td>
					<td><%=Trim(rsObj("res_num"))%></td>
					<td><%=Trim(rsObj("res_name"))%></td>
					<td><%=Trim(rsObj("meun_name"))%></td>
					<td><%=Trim(rsObj("res_url"))%></td>
					<td><%=Trim(rsObj("res_path"))%></td>
				</tr>
			<%
				rsObj.movenext
			loop 
			''关闭链接
			rsObj.close		


		%>
					</tbody>
					<tr class="line">
						<td colspan="6">
						<div></div>
						</td>
					</tr>
				</table>					
					<tr>
						<td align="right"> </td>
						<td><input name="" type="submit" value="修改保存" />&nbsp;<label id="result"></label></td>
					</tr>
				</table>
			</form>
		</div>
	</div>

	<script type="text/javascript">
		/*选中该tab页 需要tab页上有ID*/
		$("#Permissions").attr("className","on")
		
		initPage_edit();	
		//$('#scform').submit();
</script>
	
 
 
</div>



	
	
</div>
<!--footer页脚信息-->
<!--#include file="../Include/footer.asp"-->
<!--end footer页脚信息-->
</div>
</body>
</html>

<%
			Set rsObj = Nothing 

 '释放数据库链接
	call CloseConn	
	%>	
